﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;


namespace Business
{
    public class EmployeeMngr
    {
        private static TimesheetEntities timesheetContext = new TimesheetEntities();
        

        public EmployeeMngr()
        {
            //if (timesheetContext == null)
                
        }

        /*
         * Returns an employee for a specific Id
         */
        public static Employee getEmployeeById(int employeeId){
            try
            {
                return timesheetContext.Employees.First(f => f.employeeId == employeeId);
            }
            catch (InvalidOperationException ioe)
            {
                return null;
            }
            
        }
    }
}
